package cn.lili.controller.feign;

import cn.lili.modules.promotion.client.PointsGoodsClient;
import cn.lili.modules.promotion.entity.dos.PointsGoods;
import cn.lili.modules.promotion.entity.dto.search.PointsGoodsSearchParams;
import cn.lili.modules.promotion.entity.vos.PointsGoodsVO;
import cn.lili.modules.promotion.service.PointsGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: ftyy
 * @date: 2022-01-13 19:31
 * @description: 积分商品实现类
 */
@RestController
public class PointsGoodsFeignController implements PointsGoodsClient {

  @Autowired private PointsGoodsService pointsGoodsService;

  @Override
  public boolean savePointsGoodsBatch(List<PointsGoods> promotionsList) {
    return pointsGoodsService.savePointsGoodsBatch(promotionsList);
  }

  @Override
  public PointsGoodsVO getPointsGoodsDetail(String id) {
    return pointsGoodsService.getPointsGoodsDetail(id);
  }

  @Override
  public PointsGoodsVO getPointsGoodsDetailBySkuId(String skuId) {
    return pointsGoodsService.getPointsGoodsDetailBySkuId(skuId);
  }

  @Override
  public void updateById(PointsGoodsVO pointsGoodsVO) {
    pointsGoodsService.updateById(pointsGoodsVO);
  }

  @Override
  public Boolean deletePointsGoods(PointsGoodsSearchParams pointsGoodsSearchParams) {
    return pointsGoodsService.remove(pointsGoodsSearchParams.queryWrapper());
  }
}
